Skip to content

[BridgeJS] Pass String parameters unretained as (address, length)#688

Merged
kateinoigakukun merged 5 commits intoswiftwasm:mainfrom
sliemeobn:feature/unretained-strings
Mar 5, 2026
Merged

[BridgeJS] Pass String parameters unretained as (address, length)#688
kateinoigakukun merged 5 commits intoswiftwasm:mainfrom
sliemeobn:feature/unretained-strings

Conversation

@sliemeobn
Copy link
Contributor

@sliemeobn sliemeobn commented Mar 3, 2026

@sliemeobn sliemeobn marked this pull request as ready for review March 3, 2026 08:05
@sliemeobn
Copy link
Contributor Author

here are the results from the ElementaryUI benchmark:

pass retained (current BridgeJS):

  01_run1k                    200.46 ms
  02_replace1k                 538.8 ms
  03_update10th1k_x16          81.42 ms
  04_select1k                  13.35 ms
  05_swap1k                    28.29 ms
  06_remove-one-1k             20.09 ms
  08_create1k-after1k_x2      503.32 ms
  09_clear1k_x8                95.74 ms
  21_ready-memory               1.06 MB
  22_run-memory                 2.61 MB
  25_run-clear-memory           3.15 MB

pass unretained (this PR):

  01_run1k                      95.5 ms
  02_replace1k                205.06 ms
  03_update10th1k_x16          83.56 ms
  04_select1k                  13.01 ms
  05_swap1k                    28.21 ms
  06_remove-one-1k             19.41 ms
  08_create1k-after1k_x2      131.57 ms
  09_clear1k_x8                49.33 ms
  21_ready-memory               1.05 MB
  22_run-memory                 2.17 MB
  25_run-clear-memory           3.15 MB

Copy link
Member

@kateinoigakukun kateinoigakukun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you cherry-pick a8de2dd into this branch and the one comment is addressed, then we can merge this

@sliemeobn
Copy link
Contributor Author

as discussed - about the decodeString variant (sharedMemory):
we can maybe push this to a runtime-choice "on init" if we wanted to support library mode with precompiled, bundled instantiators. but we should probably do a full review if/when we want to decide this and check all compile-time variants.

Copy link
Member

@kateinoigakukun kateinoigakukun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks!

@kateinoigakukun kateinoigakukun merged commit 3d25cd9 into swiftwasm:main Mar 5, 2026
18 of 24 checks passed
@sliemeobn sliemeobn deleted the feature/unretained-strings branch March 5, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants